-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use arrays for center and bounds in tilejson #57
Conversation
Fixes #4 This does not validate that the parameter in the Mapnik XML is valid, but if it is valid, it will result in a valid TileJSON.
@@ -2,7 +2,8 @@ | |||
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over"> | |||
<Parameters> | |||
<Parameter name="metatile">1</Parameter> | |||
<Parameter name="center">-75.6038,40.0799,11</Parameter> | |||
<Parameter name="center">-75,40,11</Parameter> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any significance to making the center values all integers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No - just a shorter output in the tests
@@ -216,7 +219,11 @@ std::string make_tilejson(const mapnik::Map &map, | |||
|
|||
for (auto const &row : params) { | |||
out << "\"" << row.first << "\":"; | |||
mapnik::util::apply_visitor(json_converter(out), row.second); | |||
if (array_keys.count(row.first) > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this better than array_keys.find(row.first) == array_keys.end
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's effectively the same (well, with !=
), but I think it's more readable.
Looks good, |
Use arrays for center and bounds in tilejson
Fixes #4
This does not validate that the parameter in the Mapnik XML is valid,
but if it is valid, it will result in a valid TileJSON.
cc @zerebubuth